import agentscope
from agentscope.agents import UserAgent
from agentscope.message.msg import Msg

from agents.vision_agent import VisionAgent
from vllm_models.qwen_vl_model import Qwen2VLModel

model_configs = [
    {
        "model_type": "openai_chat",
        "config_name": "vllm-openai-api",
        "model_name": "Qwen/Qwen2.5-7B-Instruct",
        "client_args": {
            "base_url": "http://127.0.0.1:8000/v1",
        },
        "api_key": "123456",
        "generate_args": {"temperature": 0.2},
        "stream": True,
    },
]
agentscope.init(model_configs=model_configs)

show_ui_agent = VisionAgent(
    name="qwen2_vl-agent",
    model_config_name="vllm-openai-api",
    sys_prompt="You are a helper assistant.",
    vision_model=Qwen2VLModel(model_name="Qwen/Qwen2-VL-2B-Instruct", base_url="http://10.0.102.69:8000/v1",
                              api_key="123456"),
    use_memory=True,
)

user = UserAgent(name="User", input_hint="User Input ('exit' to quit): ")

vision_msg = Msg(name="user", content="描述一下这张图", role="user", url="../examples/01.PNG")

response = show_ui_agent(vision_msg)
print(response.content)
